<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <script src="../jquery/jquery-3.5.1.js"></script>
    <script type="text/javascript">
        /*window.onload=function (){
            var btnid=document.getElementById("btnId");
            btnid.onclick=function (){
                alert("js原生的单击事件");
            }
        }*/
        $(function (){
            var $btnobj=$("#btnId");
            $btnobj.click(function (){
                alert("jQuery单击事件");
            });
        });
    </script>
</head>
<body>
<button id="btnId">按钮</button>
</body>
</html>